package cn.edu.stu.syllabus.repository.oa;

import java.util.List;

import javax.inject.Inject;

import cn.edu.stu.syllabus.repository.oa.local.OaInfoEntry;
import cn.edu.stu.syllabus.di.qualifier.Remote;
import cn.edu.stu.syllabus.di.scope.FragmentScoped;
import rx.Observable;

/**
 * Created by daidaijie on 2017/3/14.
 */

@FragmentScoped
public class OaDataRepository implements OaDataSource {

    OaDataSource mOaRemoteDataSource;

    @Inject
    public OaDataRepository(@Remote OaDataSource oaRemoteDataSource) {
        mOaRemoteDataSource = oaRemoteDataSource;
    }

    @Override
    public Observable<List<OaInfoEntry>> getOaInfoEntries(OaSearchInfo oaSearchInfo, int start, int end) {
        return mOaRemoteDataSource.getOaInfoEntries(oaSearchInfo, start, end);
    }

    @Override
    public boolean isSourceEmpty(Throwable errMsg) {
        return mOaRemoteDataSource.isSourceEmpty(errMsg);
    }

}
